3.4.93 \(\int \frac {\sqrt {a+b x} (A+B x)}{x^2} \, dx\) [393]

Optimal. Leaf size=71 \[ \frac {(A b+2 a B) \sqrt {a+b x}}{a}-\frac {A (a+b x)^{3/2}}{a x}-\frac {(A b+2 a B) \tanh ^{-1}\left (\frac {\sqrt {a+b x}}{\sqrt {a}}\right )}{\sqrt {a}} \]

[Out]

-A*(b*x+a)^(3/2)/a/x-(A*b+2*B*a)*arctanh((b*x+a)^(1/2)/a^(1/2))/a^(1/2)+(A*b+2*B*a)*(b*x+a)^(1/2)/a

________________________________________________________________________________________

Rubi [A]
time = 0.02, antiderivative size = 71, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 18, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.222, Rules used = {79, 52, 65, 214} \begin {gather*} \frac {\sqrt {a+b x} (2 a B+A b)}{a}-\frac {(2 a B+A b) \tanh ^{-1}\left (\frac {\sqrt {a+b x}}{\sqrt {a}}\right )}{\sqrt {a}}-\frac {A (a+b x)^{3/2}}{a x} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(Sqrt[a + b*x]*(A + B*x))/x^2,x]

[Out]

((A*b + 2*a*B)*Sqrt[a + b*x])/a - (A*(a + b*x)^(3/2))/(a*x) - ((A*b + 2*a*B)*ArcTanh[Sqrt[a + b*x]/Sqrt[a]])/S
qrt[a]

Rule 52

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> Simp[(a + b*x)^(m + 1)*((c + d*x)^n/(b*(
m + n + 1))), x] + Dist[n*((b*c - a*d)/(b*(m + n + 1))), Int[(a + b*x)^m*(c + d*x)^(n - 1), x], x] /; FreeQ[{a
, b, c, d}, x] && NeQ[b*c - a*d, 0] && GtQ[n, 0] && NeQ[m + n + 1, 0] &&  !(IGtQ[m, 0] && ( !IntegerQ[n] || (G
tQ[m, 0] && LtQ[m - n, 0]))) &&  !ILtQ[m + n + 2, 0] && IntLinearQ[a, b, c, d, m, n, x]

Rule 65

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> With[{p = Denominator[m]}, Dist[p/b, Sub
st[Int[x^(p*(m + 1) - 1)*(c - a*(d/b) + d*(x^p/b))^n, x], x, (a + b*x)^(1/p)], x]] /; FreeQ[{a, b, c, d}, x] &
& NeQ[b*c - a*d, 0] && LtQ[-1, m, 0] && LeQ[-1, n, 0] && LeQ[Denominator[n], Denominator[m]] && IntLinearQ[a,
b, c, d, m, n, x]

Rule 79

Int[((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Simp[(-(b*e - a*f
))*(c + d*x)^(n + 1)*((e + f*x)^(p + 1)/(f*(p + 1)*(c*f - d*e))), x] - Dist[(a*d*f*(n + p + 2) - b*(d*e*(n + 1
) + c*f*(p + 1)))/(f*(p + 1)*(c*f - d*e)), Int[(c + d*x)^n*(e + f*x)^(p + 1), x], x] /; FreeQ[{a, b, c, d, e,
f, n}, x] && LtQ[p, -1] && ( !LtQ[n, -1] || IntegerQ[p] ||  !(IntegerQ[n] ||  !(EqQ[e, 0] ||  !(EqQ[c, 0] || L
tQ[p, n]))))

Rule 214

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[-a/b, 2]/a)*ArcTanh[x/Rt[-a/b, 2]], x] /; FreeQ[{a, b},
x] && NegQ[a/b]

Rubi steps

\begin {align*} \int \frac {\sqrt {a+b x} (A+B x)}{x^2} \, dx &=-\frac {A (a+b x)^{3/2}}{a x}+\frac {\left (\frac {A b}{2}+a B\right ) \int \frac {\sqrt {a+b x}}{x} \, dx}{a}\\ &=\frac {(A b+2 a B) \sqrt {a+b x}}{a}-\frac {A (a+b x)^{3/2}}{a x}+\frac {1}{2} (A b+2 a B) \int \frac {1}{x \sqrt {a+b x}} \, dx\\ &=\frac {(A b+2 a B) \sqrt {a+b x}}{a}-\frac {A (a+b x)^{3/2}}{a x}+\frac {(A b+2 a B) \text {Subst}\left (\int \frac {1}{-\frac {a}{b}+\frac {x^2}{b}} \, dx,x,\sqrt {a+b x}\right )}{b}\\ &=\frac {(A b+2 a B) \sqrt {a+b x}}{a}-\frac {A (a+b x)^{3/2}}{a x}-\frac {(A b+2 a B) \tanh ^{-1}\left (\frac {\sqrt {a+b x}}{\sqrt {a}}\right )}{\sqrt {a}}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.11, size = 53, normalized size = 0.75 \begin {gather*} \frac {\sqrt {a+b x} (-A+2 B x)}{x}-\frac {(A b+2 a B) \tanh ^{-1}\left (\frac {\sqrt {a+b x}}{\sqrt {a}}\right )}{\sqrt {a}} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(Sqrt[a + b*x]*(A + B*x))/x^2,x]

[Out]

(Sqrt[a + b*x]*(-A + 2*B*x))/x - ((A*b + 2*a*B)*ArcTanh[Sqrt[a + b*x]/Sqrt[a]])/Sqrt[a]

________________________________________________________________________________________

Maple [A]
time = 0.07, size = 50, normalized size = 0.70

method result size
derivativedivides \(2 B \sqrt {b x +a}-\frac {A \sqrt {b x +a}}{x}-\frac {\left (A b +2 B a \right ) \arctanh \left (\frac {\sqrt {b x +a}}{\sqrt {a}}\right )}{\sqrt {a}}\) \(50\)
default \(2 B \sqrt {b x +a}-\frac {A \sqrt {b x +a}}{x}-\frac {\left (A b +2 B a \right ) \arctanh \left (\frac {\sqrt {b x +a}}{\sqrt {a}}\right )}{\sqrt {a}}\) \(50\)
risch \(2 B \sqrt {b x +a}-\frac {A \sqrt {b x +a}}{x}-\frac {\left (A b +2 B a \right ) \arctanh \left (\frac {\sqrt {b x +a}}{\sqrt {a}}\right )}{\sqrt {a}}\) \(50\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((B*x+A)*(b*x+a)^(1/2)/x^2,x,method=_RETURNVERBOSE)

[Out]

2*B*(b*x+a)^(1/2)-A*(b*x+a)^(1/2)/x-(A*b+2*B*a)*arctanh((b*x+a)^(1/2)/a^(1/2))/a^(1/2)

________________________________________________________________________________________

Maxima [A]
time = 0.48, size = 76, normalized size = 1.07 \begin {gather*} \frac {1}{2} \, b {\left (\frac {4 \, \sqrt {b x + a} B}{b} + \frac {{\left (2 \, B a + A b\right )} \log \left (\frac {\sqrt {b x + a} - \sqrt {a}}{\sqrt {b x + a} + \sqrt {a}}\right )}{\sqrt {a} b} - \frac {2 \, \sqrt {b x + a} A}{b x}\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((B*x+A)*(b*x+a)^(1/2)/x^2,x, algorithm="maxima")

[Out]

1/2*b*(4*sqrt(b*x + a)*B/b + (2*B*a + A*b)*log((sqrt(b*x + a) - sqrt(a))/(sqrt(b*x + a) + sqrt(a)))/(sqrt(a)*b
) - 2*sqrt(b*x + a)*A/(b*x))

________________________________________________________________________________________

Fricas [A]
time = 0.93, size = 124, normalized size = 1.75 \begin {gather*} \left [\frac {{\left (2 \, B a + A b\right )} \sqrt {a} x \log \left (\frac {b x - 2 \, \sqrt {b x + a} \sqrt {a} + 2 \, a}{x}\right ) + 2 \, {\left (2 \, B a x - A a\right )} \sqrt {b x + a}}{2 \, a x}, \frac {{\left (2 \, B a + A b\right )} \sqrt {-a} x \arctan \left (\frac {\sqrt {b x + a} \sqrt {-a}}{a}\right ) + {\left (2 \, B a x - A a\right )} \sqrt {b x + a}}{a x}\right ] \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((B*x+A)*(b*x+a)^(1/2)/x^2,x, algorithm="fricas")

[Out]

[1/2*((2*B*a + A*b)*sqrt(a)*x*log((b*x - 2*sqrt(b*x + a)*sqrt(a) + 2*a)/x) + 2*(2*B*a*x - A*a)*sqrt(b*x + a))/
(a*x), ((2*B*a + A*b)*sqrt(-a)*x*arctan(sqrt(b*x + a)*sqrt(-a)/a) + (2*B*a*x - A*a)*sqrt(b*x + a))/(a*x)]

________________________________________________________________________________________

Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 155 vs. \(2 (60) = 120\).
time = 5.57, size = 155, normalized size = 2.18 \begin {gather*} - \frac {A a b \sqrt {\frac {1}{a^{3}}} \log {\left (- a^{2} \sqrt {\frac {1}{a^{3}}} + \sqrt {a + b x} \right )}}{2} + \frac {A a b \sqrt {\frac {1}{a^{3}}} \log {\left (a^{2} \sqrt {\frac {1}{a^{3}}} + \sqrt {a + b x} \right )}}{2} + \frac {2 A b \operatorname {atan}{\left (\frac {\sqrt {a + b x}}{\sqrt {- a}} \right )}}{\sqrt {- a}} - \frac {A \sqrt {a + b x}}{x} + \frac {2 B a \operatorname {atan}{\left (\frac {\sqrt {a + b x}}{\sqrt {- a}} \right )}}{\sqrt {- a}} + 2 B \sqrt {a + b x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((B*x+A)*(b*x+a)**(1/2)/x**2,x)

[Out]

-A*a*b*sqrt(a**(-3))*log(-a**2*sqrt(a**(-3)) + sqrt(a + b*x))/2 + A*a*b*sqrt(a**(-3))*log(a**2*sqrt(a**(-3)) +
 sqrt(a + b*x))/2 + 2*A*b*atan(sqrt(a + b*x)/sqrt(-a))/sqrt(-a) - A*sqrt(a + b*x)/x + 2*B*a*atan(sqrt(a + b*x)
/sqrt(-a))/sqrt(-a) + 2*B*sqrt(a + b*x)

________________________________________________________________________________________

Giac [A]
time = 2.07, size = 61, normalized size = 0.86 \begin {gather*} \frac {2 \, \sqrt {b x + a} B b - \frac {\sqrt {b x + a} A b}{x} + \frac {{\left (2 \, B a b + A b^{2}\right )} \arctan \left (\frac {\sqrt {b x + a}}{\sqrt {-a}}\right )}{\sqrt {-a}}}{b} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((B*x+A)*(b*x+a)^(1/2)/x^2,x, algorithm="giac")

[Out]

(2*sqrt(b*x + a)*B*b - sqrt(b*x + a)*A*b/x + (2*B*a*b + A*b^2)*arctan(sqrt(b*x + a)/sqrt(-a))/sqrt(-a))/b

________________________________________________________________________________________

Mupad [B]
time = 0.41, size = 49, normalized size = 0.69 \begin {gather*} 2\,B\,\sqrt {a+b\,x}-\frac {\mathrm {atanh}\left (\frac {\sqrt {a+b\,x}}{\sqrt {a}}\right )\,\left (A\,b+2\,B\,a\right )}{\sqrt {a}}-\frac {A\,\sqrt {a+b\,x}}{x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(((A + B*x)*(a + b*x)^(1/2))/x^2,x)

[Out]

2*B*(a + b*x)^(1/2) - (atanh((a + b*x)^(1/2)/a^(1/2))*(A*b + 2*B*a))/a^(1/2) - (A*(a + b*x)^(1/2))/x

________________________________________________________________________________________